/**
 * Title: ErrorReportUtil.java
 * Description:
 * Copyright: Copyright (c) 2008
 * Company:深圳彩讯科技有限公司
 * Author 罗旭东 (hi@luoxudong.com)
 * Date 2013-8-19 上午11:02:10
 * Version 1.0
 */
package com.luoxudong.phonenumber.logic.errorreport;

import android.content.Context;
import android.content.pm.PackageInfo;
import android.location.Location;
import android.os.Build;
import android.telephony.TelephonyManager;

import com.luoxudong.phonenumber.service.net.http.asynchttp.AsyncHttpUtil;
import com.luoxudong.phonenumber.service.utils.MetaDataUtil;
import com.luoxudong.phonenumber.service.utils.PackageUtil;

/** 
 * ClassName: ErrorReportUtil
 * Description:异常上报
 * Create by 罗旭东
 * Date 2013-8-19 上午11:02:10
 */
public class ErrorReportUtil {
	public static void Report(Context context, String userName, String content)
	{
		/*PackageInfo packageInfo = PackageUtil.getPackageInfoByPackageName(context, context.getPackageName());
		Location location = PackageUtil.getPhoneLocation(context);
		TelephonyManager telephonyManager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
		ErrorReportReq errorInfo = new ErrorReportReq();
		
		if (packageInfo != null)
		{
			errorInfo.setAppName("ThinkDrive");
			errorInfo.setAppVersion(String.valueOf(packageInfo.versionCode));
			errorInfo.setVersionName(packageInfo.versionName);
		}
		
		if (telephonyManager != null)
		{
			errorInfo.setIMEI(telephonyManager.getDeviceId());
			errorInfo.setPhoneNum(telephonyManager.getLine1Number());
		}
		
		if (location != null)
		{
			errorInfo.setLocation(location.getLatitude() + "-" + location.getLongitude());
		}
		
		errorInfo.setProductId(MetaDataUtil.getProductId(context));
		errorInfo.setContent(content);
		errorInfo.setMacAddress(PackageUtil.getLocalMacAddress(context));
		errorInfo.setMailFromAddress("luoxudong@richinfo.cn");
		errorInfo.setMailUserName("luoxudong@richinfo.cn");
		errorInfo.setMailPassword("1q2w3e");
		errorInfo.setMailServerHost("smtp.richinfo.cn");
		errorInfo.setMailServerPort("25");
		errorInfo.setMailToAddress("luoxudong@richinfo.cn;");
		errorInfo.setOsName("android");
		errorInfo.setPackageName(context.getPackageName());
		errorInfo.setPhoneModel(Build.MODEL);
		errorInfo.setScreenScale(PackageUtil.getScreenScale(context));
		errorInfo.setScreenSize(PackageUtil.getScreenSize(context));
		errorInfo.setSdkVersion(Build.VERSION.SDK);
		errorInfo.setSdkVersionName(Build.VERSION.RELEASE);
		errorInfo.setUserName(userName);
		
		AsyncHttpUtil.customJsonRequest(MetaDataUtil.getErrorReportService(context), errorInfo, ErrorReportRsp.class, null);*/
	}
}
